package com.sitanyun.merchant.guide.frament.view.activity;

import android.os.Bundle;
import android.widget.TextView;

import com.flyco.tablayout.SlidingTabLayout;
import com.sitanyun.merchant.guide.R;
import com.sitanyun.merchant.guide.adapter.TabAdapter;
import com.sitanyun.merchant.guide.base.BaseActivity;
import com.sitanyun.merchant.guide.base.BaseFragment;
import com.sitanyun.merchant.guide.frament.view.fragment.BrowFragment;
import com.sitanyun.merchant.guide.frament.view.fragment.EnterFragment;
import com.sitanyun.merchant.guide.frament.view.fragment.ShtopFragment;
import com.sitanyun.merchant.guide.weiht.SharedPreferenceUtil;
import com.sitanyun.merchant.guide.weiht.SharedPreferenceshop;

import androidx.viewpager.widget.ViewPager;
import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 排名详情
 */
public class EnterShopDailsActivity extends BaseActivity {


    @BindView(R.id.shop_name)
    TextView shopName;
    @BindView(R.id.tab_view)
    SlidingTabLayout tabView;
    @BindView(R.id.vp_view)
    ViewPager vpView;
    private static final String[] mTitle = {"分享次数", "浏览次数","浏览用户数"};
   private static final BaseFragment[] size = new BaseFragment[]{new ShtopFragment(), new EnterFragment(),new BrowFragment()};
    @Override
    public int getLayoutId() {
        return R.layout.activity_enter_shop_dails;
    }

    @Override
    public void initData(Bundle savedInstanceState) {
        setFindViewById(true);
        setTitleStr("我的排名");
        vpView.setAdapter(new TabAdapter(mActivity,getSupportFragmentManager(), mTitle, size));
        tabView.setViewPager(vpView);
        /**
         * 企业还是门店   1门店 2企业
         */
        if (  SharedPreferenceshop.getStringData("type").equals("1")){
            shopName.setText(SharedPreferenceUtil.getStringData("nodename"));
        }else {
            shopName.setText(SharedPreferenceUtil.getStringData("merchat"));
        }

    }

    @Override
    public void initView() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }
}
